package cn.study.completableFutureTest.flow;


import cn.study.tools.SleepTools;

import java.util.concurrent.CompletableFuture;


/**
 * @Author     ：跟大佳一起学架构
 * @Description：运行后执行类
 */
public class RunAfterBoth {
    public static void main(String[] args) {
        CompletableFuture.supplyAsync(() -> {
            SleepTools.second(1);
            return "s1";
        }).runAfterBothAsync(CompletableFuture.supplyAsync(() -> {
            SleepTools.second(2);
            return "s2";
        }), () -> System.out.println("hello world"));
        SleepTools.second(3);
    }
}
